package com.cris.service;

import com.cris.helper.DatabaseHelper;
import com.cris.model.Stuff;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * Created by owen on 2017/5/18.
 */
@Service
public class StuffService {
    //根据名字获得stuff
    public Stuff getStuffByName(String name){
        String sql = "select *from stuff where name='"+name+"'";
        return DatabaseHelper.queryEntity(Stuff.class,sql);
    }
    //注册stuff
    public boolean addStuff(Map<String,Object> map){
        return DatabaseHelper.insertEntity(Stuff.class,map);
    }
}
